<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>系统注册</title>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta
            name="viewport"
            content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
    />
    <link rel="stylesheet" href="../layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../style/admin.css" media="all"/>
    <link rel="stylesheet" href="../style/home.css" media="all"/>
    <script src="../layui/layui.js"></script>
    <style>
        .layui-form-item .layui-inline {
            padding-right: 0px;
            margin-right: 0px;
        }

        html,
        body {
            background-color: #fff;
            width: 100%;
            height: 100%;
            margin: 0px;
            padding: 0px;
            border: 0px;
        }
    </style>
</head>
<body layadmin-themealias="default">
<div class="" style="padding: 20px;">
    <div class="layui-row layui-col-space15" style="width: 1000px">
        <div class="layui-input-block" style="margin-left: 15px;">
            <blockquote class="layui-elem-quote layui-quote-nm">
                <h3>注册信息：</h3>
                <p th:text="${'授权用户组织：'+regInfo.organization}"></p>
                <p th:text="${'授权用户数：'+regInfo.users}"></p>
                <p th:text="${'授权有效期：'+regInfo.expirationDate}"></p>
                <p th:text="${'备注：'+regInfo.remark}"></p>
            </blockquote>
            <hr>
        </div>
        <div class="layui-card pr20" style=" height: 440px">

            <form class="layui-form" lay-filter="postData" action="" id="postData">
                <input type="hidden" name="id" value="put" th:value="${data.id}"/>
                <div class="layui-form-item">
                    <label class="layui-form-label">注册码</label>
                    <div class="layui-input-block">
                        <input type="text" name="registerCode"
                               autocomplete="off" class="layui-input" required lay-verify="required" disabled
                               th:value="${data.registerCode}"
                        />
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">授权码</label>
                    <div class="layui-input-block">
                            <textarea name="licenseCode" placeholder="请输入授权码" style="height: 200px;"
                                      autocomplete="off" class="layui-textarea" required lay-verify="required"
                                      th:text="${data.licenseCode}"
                            />
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="submit" class="layui-btn layui-bg-blue layui-btn-sm" lay-submit=""
                                lay-filter="postData" id="postBut">
                            <i class="layui-icon layui-icon-ok"></i>
                            注册
                        </button>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
<script>
    layui.use(['form'], function () {
        var $ = layui.$, form = layui.form;
        form.render();

        form.on('submit(postData)', function (obj) {
            var data = obj.field;
            $.ajax({
                url: './saveSystemRegister', //url
                contentType: 'application/json',
                dataType: 'json', //数据格式
                type: 'POST', //请求方式
                async: false, //是否异步请求
                data: JSON.stringify(data),
                success: function (result) {
                    if (result.code == 0) {
                        parent.layer.msg(result.message, {icon: 1});
                    } else {
                        parent.layer.alert(result.message, {icon: 2});
                    }
                },
            });
            return false;
        });
    });

</script>
<script type="text/javascript" src="../js/lib/watermark.js"></script>
</body>
</html>
